package com.jack.leetcode.每日一题;

public class 乘机最大子数组 {

    public int maxProduct(int[] nums) {
        int n = nums.length;
        int max = nums[0];
        for(int i=0;i<n;i++){
            int tmp = nums[i];
            if(tmp>max){
                max = tmp;
            }
            for(int j=i+1;j<n;j++){
                tmp *= nums[j];
                if(tmp>max){
                    max = tmp;
                }
            }
        }
        return max;
    }
}
